workspace "RpgEngine"
	architecture "x64"
	configurations {
		"Debug",
		"Release",
		"Dist"
	}

	IncludeDir = {}
	IncludeDir["GLFW"] = "RpgEngine/vendor/GLFW/include"
	IncludeDir["Glad"] = "RpgEngine/vendor/Glad/include"
	IncludeDir["ImGui"] = "RpgEngine/vendor/imgui"
	IncludeDir["glm"] = "RpgEngine/vendor/glm"
	include "RpgEngine/vendor/GLFW"
	include "RpgEngine/vendor/Glad"
	include "RpgEngine/vendor/imgui"
	


project "RpgEngine"
		location "RpgEngine"
		kind "SharedLib"
		language "C++"

		files{
			"%{prj.name}/src/**.h",
			"%{prj.name}/src/**.cpp",
			"%{prj.name}/vendor/glm/glm/**.hpp",
			"%{prj.name}/vendor/glm/glm/**.inl"
		}

		targetdir ("bin/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/%{prj.name}")
		objdir ("bin-int/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/%{prj.name}")
		
		pchheader "rpgpch.h"
		pchsource "RpgEngine/src/rpgpch.cpp"

		includedirs
		{
			"%{prj.name}/vendor/spdlog/include",
			"%{prj.name}/src",
			"%{IncludeDir.GLFW}",
			"%{IncludeDir.Glad}",
			"%{IncludeDir.ImGui}",
			"%{IncludeDir.glm}"
		}

		links {
			"Glad",
			"GLFW",
			"ImGui",
			"opengl32.lib"
		}

		filter "system:windows"
			cppdialect "c++17"
			staticruntime "On"
			systemversion "10.0"

		defines
		{
			"RPG_PLATFORM_WINDOW","RPG_ENGINE_DLL","GLFW_INCLUDE_NONE"
		}
		postbuildcommands
		{
			("{COPY} %{cfg.buildtarget.relpath} ../bin/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/Example")
		}
		filter "configurations:Debug"
			defines {
				"RPG_DEBUG",
				"RPG_ENABLE_ASSERT"
			}
			buildoptions "/MDd"
			symbols "On"
		filter "configurations:Release"
			defines "RPG_RELEASE"
			buildoptions "/MD"
			optimize "On"
		filter "configurations:Dist"
			defines "RPG_DIST"
			buildoptions "/MD"
			optimize "On"


project "Example"
		location "Example"
		kind "ConsoleApp"
		language "c++"

		targetdir ("bin/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/%{prj.name}")
		objdir ("bin-int/%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}/%{prj.name}")

		files{
			"%{prj.name}/src/**.h",
			"%{prj.name}/src/**.cpp",
		}

		

		includedirs
		{
			"RpgEngine/vendor/spdlog/include",
			"RpgEngine/src",
			"%{IncludeDir.glm}"
		}

		links
		{
			"RpgEngine"
		}

		filter "system:windows"
			cppdialect "c++17"
			staticruntime "On"
			systemversion "10.0"

		defines
		{
			"RPG_PLATFORM_WINDOW"
		}
	
		filter "configurations:Debug"
			defines {
				"RPG_DEBUG",
				"RPG_ENABLE_ASSERT"
			}
			symbols "On"
		filter "configurations:Release"
			defines "RPG_RELEASE"
			optimize "On"
		filter "configurations:Dist"
			defines "RPG_DIST"
			optimize "On"